package com.xxx.coll;

import java.util.HashSet;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/20  16:16
 * @Copyright
 */
public class hashsetDome {
    public static void main(String[] args) {
        HashSet<worker> hashSet = new HashSet<>();
        hashSet.add(new worker("张三",26));
        hashSet.add(new worker("赵六",22));
        hashSet.add(new worker("王五",23));
        hashSet.add(new worker("李四",25));
        hashSet.add(new worker("孙二",26));
        hashSet.add(new worker("孙二",26));

        for (worker s : hashSet) {
            System.out.println("s = " + s.getName());
        }

    }
}
